<template>
  <div>
    <el-table v-loading="isloading" :data="tableData" style="width: 100%;height:600px">
      <el-table-column v-for="(item,key) in tableTitle" :key="key" :prop="item.prop" :label="item.lable" />
      <el-table-column prop="item" label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleClick(scope.row)">编辑</el-button>
          <el-button style="color:red" type="text" size="small">禁用</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="pagination">
      <el-pagination
        :current-page="1"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="total, sizes, prev, pager, next, jumper"
        :total="400"
      /></div>
  </div>
</template>

<script>
import { getList } from '@/api/table'
import { TAKEAWAYAPI } from '@/api/request/request'
export default {
  data() {
    return {
      isloading: true,
      tableData: [
      ],
      tableTitle: [{ prop: 'author', lable: '员工姓名' }, { prop: 'display_time', lable: '下单时间' }, { prop: 'id', lable: '订单号' }, { prop: 'pageviews', lable: '序列号' }, { prop: 'status', lable: '状态' }, { prop: 'title', lable: '留言' }]
    }
  },
  async mounted() {
    this.funlist()
    try {
      this.isloading = true
      const data = await getList()
      this.tableData = data.data.items
    } finally {
      this.isloading = false
    }
  },
  methods: {
    async funlist() {
      try {
        await TAKEAWAYAPI.getMemberList()
      } catch {
        console.log('error list')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
    .pagination{
      margin-top: 30px;
      display: flex;
      justify-content: center;
    }
</style>
